﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Resources;
using System.Globalization;
using System.Threading;
using EHTWebsite.Code;
using System.Data;

namespace EHTWebsiteProject
{
    public partial class CongNghe : System.Web.UI.Page
    {
        public Boolean IsVN = true;
        private String languageCode = "vi-VN";
        private Int32 danhMucTinTucID = 29;
        private Int32 pageIndex = 1;
        private Int32 pageSize = 12;
        private Int32 totalRecord = 0;

        private ResourceManager rm = new ResourceManager("Resources.SiteMap", System.Reflection.Assembly.Load("App_GlobalResources"));

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                languageCode = Session[HangSo.LANGUAGE_CODE].ToString();

                if (languageCode == "en-us")
                {
                    IsVN = false;
                }

            }
            catch (Exception ex)
            {
            }

            try
            {
                pageIndex = Int32.Parse(Request.QueryString["PageIndex"].ToString());
            }
            catch (Exception ex)
            {
            }

            try
            {
                danhMucTinTucID = Int32.Parse(Request.QueryString["CategoryID"].ToString());
            }
            catch (Exception ex)
            {
            }

            if (!Page.IsPostBack)
            {


                DataSet dsTinTucs = TinTucProvider.GetTinTucsByFillterForFrontEnd("", "", danhMucTinTucID, pageIndex, pageSize, out totalRecord);
                this.rpNews.DataSource = dsTinTucs;
                this.rpNews.DataBind();

                //Thread.CurrentThread.CurrentCulture = new CultureInfo(languageCode);
                //LoadLanguage(Thread.CurrentThread.CurrentCulture);
            }
        }

        public String FormatStringForUrl(String input)
        {
            return HelpMethod.FormatStringForUrl(input);
        }
    }
}